(function(){"use strict";BX.namespace("BX.Landing");var e=BX.Landing.Utils.bind;var n=BX.Landing.Utils.data;var t=BX.Landing.Utils.isEmpty;var i=BX.Landing.Utils.isPlainObject;var a=BX.Landing.Utils.slice;var r=BX.Landing.Utils.findParent;var l=BX.Landing.Utils.trim;var c=BX.Landing.Utils.join;var o=BX.Landing.Utils.attr;function s(e,n,t){switch(t){case"show":return u(e,n);case"click":return d(e,n);default:return function(){}}}function u(e,n){if(!e.blockWiewMap.has(n)){e.intersectionObserver.observe(n);e.blockWiewMap.set(n,null)}}function d(n,t){var i=[].concat(a(t.querySelectorAll("a")),a(t.querySelectorAll("button")),a(t.querySelectorAll("[data-pseudo-url]")));i.forEach(function(t){if(!n.clickMap.has(t)){e(t,"click",f.bind(null,n,t));n.clickMap.set(t,null)}})}function f(e,n){var t=r(n,{className:"block-wrapper"});var i={type:"click",category:c("#",t.id),label:l(n.innerText)};if(e.options.labelFrom==="href"){if(n.tagName==="A"&&BX.Type.isStringFilled(n.href)){i.label=n.href}else{var a=BX.Landing.Utils.data(n,"data-pseudo-url");if(BX.Type.isPlainObject(a)&&a.enabled&&BX.Type.isStringFilled(a.href)){i.label=a.href}}}else if(!BX.Type.isStringFilled(i.label)){if(n.tagName==="IMG"&&o(n,"alt")){i.label=o(n,"alt")}else{var s=n.firstElementChild;if(s&&s.tagName==="IMG"&&o(s,"alt")){i.label=o(s,"alt")}}}e.push(i)}function h(e){var a=n(e);var r={};if(i(a)&&!t(a)){r.event=a["data-event-tracker"]||[];r.labelFrom=a["data-event-tracker-label-from"]||"text"}return r}function v(e,n){g(e,n);var t=setTimeout(function(){var t=r(n,{className:"block-wrapper"});e.push({category:"Block",type:"show",label:"#"+t.id})},1e3);e.blockWiewMap.set(n,t)}function g(e,n){clearTimeout(e.blockWiewMap.get(n));e.blockWiewMap.set(n,0)}function b(e){var n=window.innerHeight;if(e.boundingClientRect.height<=n/2){return.9}if(e.boundingClientRect.height>=n){var t=Math.min(e.boundingClientRect.height,n)/Math.max(e.boundingClientRect.height,n);return t-t/100*10}return.7}function p(e,n){n.forEach(function(n){if(n.intersectionRatio>=b(n)){v(e,n.target);return}g(e,n.target)})}BX.Landing.EventTracker=function(){this.intersectionObserver=new IntersectionObserver(p.bind(null,this),{threshold:[0,.05,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]});this.blockWiewMap=new WeakMap;this.clickMap=new WeakMap;this.services=[new BX.Landing.EventTracker.Service.GoogleAnalytics];this.options=h(document.body)};BX.Landing.EventTracker.getInstance=function(){return BX.Landing.EventTracker.instance||(BX.Landing.EventTracker.instance=new BX.Landing.EventTracker)};BX.Landing.EventTracker.prototype={observe:function(e){var n=h(document.body);if(i(n)&&!t(n)){n.event.forEach(s.bind(null,this,e))}},push:function(e){this.services.forEach(function(n){n.push(e)})},run:function(){a(document.querySelectorAll(".block-wrapper > *:first-child")).forEach(this.observe,this)}}})();
//# sourceMappingURL=event-tracker.map.js